class Solution:
    def maximum69Number(self, num: int) -> int:
        c_list = [x for x in str(num)]
        for idx, c in enumerate(c_list):
            if c == '6':
                c_list[idx] = '9'
                break
        return int(''.join(c_list))
